export {bus} from "./bus"
export const validate = {
    mobile:/^1(3|5|6|7|8|9)\d{9}$/
}

export const mymixins = {
    methods:{
        seeBigCode(link){
            layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                area: ['auto'],
                skin: 'layui-layer-nobg', //没有背景色
                shadeClose: true,
                content: "<div id='qrcode' class='layui-layer-content-content'></div>",
                success(){
                    $('.layui-layer-content').css('padding', '0px');
                    $('.layui-layer-content').css('height', '240');
                    $('.layui-layer-content').css('width', '240');
                    $('.layui-layer-content').css('overflow', 'hidden');
                    $('.layui-layer').css({
                        width: '240px',
                        height: '240px',
                    });
                     console.log(link);
                    var qrcode = new QRCode('qrcode', {
                        width: 240,
                        height: 240,
                        colorDark : '#000000',
                        colorLight : '#ffffff',
                        correctLevel : QRCode.CorrectLevel.H,
                        // text:link
                    });
                    qrcode.clear(); // 每次点击清除旧的二维码
                    qrcode.makeCode(link)
                }
            });
        }
    }
}

